package com.eight.handle;

import com.eight.execption.NoPermissionException;
import com.eight.vo.ComResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Description: TODO
 * @Author: Van.Planifolia
 * @CreateTime: 2023-02-24  10:15
 * @Version: 1.0
 */
@RestControllerAdvice
public class GobleExceptionHandler {
    /**
     * 没权限异常的处理器
     * @param e 没权限异常
     * @return 返回的错误处理信息
     */
    @ExceptionHandler(value = NoPermissionException.class)
    public ComResult handle01(NoPermissionException e){
        return new ComResult(4001,e.getMessage());
    }
}
